﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThanhTu.GNCMedia.KQXS.DataAccess.DAL;

namespace WebUI.Admin.UserControls
{
    public partial class ActionProvince : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ProvinceDAL province = new ProvinceDAL();
            RepeaterProvince.DataSource = province.selectadd();
            RepeaterProvince.DataBind();
        }

        protected void RepeaterProvince_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
            {
                ProvinceDAL province = new ProvinceDAL();
                int checkDel = province.delete(e.CommandName);
                if (checkDel > 0)
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowStatus", "javascript:alert('XÓA TỈNH Thành công);", true);
                }
                else
                {
                    Page.ClientScript.RegisterStartupScript(this.GetType(), "ShowStatus", "javascript:alert('LỖI,XIN VUI LÒNG THỬ LẠI);", true);
                }
            }
        }

        protected void lbtn_first_Click(object sender, EventArgs e)
        {

        }

        protected void lbtn_pre_Click(object sender, EventArgs e)
        {

        }

        protected void lbtntnext_Click(object sender, EventArgs e)
        {

        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {

        }
    }
}